package org.yaglyf.api.entity;

import java.io.Serializable;

public class UserInfo implements Serializable {
    private Integer id;

    private String urseName;

    private String userPassword;

    private String salt;

    private Integer urlId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUrseName() {
        return urseName;
    }

    public void setUrseName(String urseName) {
        this.urseName = urseName == null ? null : urseName.trim();
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword == null ? null : userPassword.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    public Integer getUrlId() {
        return urlId;
    }

    public void setUrlId(Integer urlId) {
        this.urlId = urlId;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("UserInfo{");
        sb.append("id=").append(id);
        sb.append(", urseName='").append(urseName).append('\'');
        sb.append(", userPassword='").append(userPassword).append('\'');
        sb.append(", salt='").append(salt).append('\'');
        sb.append(", urlId=").append(urlId);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserInfo userInfo = (UserInfo) o;
        if (id != null ? !id.equals(userInfo.id) : userInfo.id != null) return false;
        if (urseName != null ? !urseName.equals(userInfo.urseName) : userInfo.urseName != null) return false;
        if (userPassword != null ? !userPassword.equals(userInfo.userPassword) : userInfo.userPassword != null) return false;
        if (salt != null ? !salt.equals(userInfo.salt) : userInfo.salt != null) return false;
        return urlId != null ? urlId.equals(userInfo.urlId) : userInfo.urlId == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (urseName != null ? urseName.hashCode() : 0);
        result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0);
        result = 31 * result + (salt != null ? salt.hashCode() : 0);
        result = 31 * result + (urlId != null ? urlId.hashCode() : 0);
        return result;
    }
}